package com.zhuoyue.biz.core.command.cmd.common.faa.base;

import com.zhuoyue.common.constant.ControlType;

/**
 * @author hewenze
 */

public enum IndexType_0FAA8A09 {
    //单个控制
    control("control", "03EF"),
    //联控
    linkage("linkage", "1777");

    private String code;
    private String childOd;

    IndexType_0FAA8A09(String code, String childOd) {
        this.code = code;
        this.childOd = childOd;
    }

    public String getCode() {
        return code;
    }

    public String getChildOd() {
        return childOd;
    }


    /**
     * 根据Key得到枚举的Value
     * 普通for循环遍历，比较判断
     *
     * @param key
     * @return
     */
    public static String getEnumType(String key) {
        IndexType_0FAA8A09[] alarmGrades = IndexType_0FAA8A09.values();
        for (int i = 0; i < alarmGrades.length; i++) {
            if (alarmGrades[i].getCode().equals(key)) {
                return alarmGrades[i].getChildOd();
            }
        }
        return "";
    }

}
